package com.mt.roll.core.dal.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 微信模板消息表
 * </p>
 *
 * @author mt
 * @since 2021-12-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_wechat_template_message")
public class WechatTemplateMessage extends Model<WechatTemplateMessage> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
      @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 账号ID
     */
    @TableField("account_id")
    private Long accountId;

    /**
     * 用户类型	            1、平台	            2、药店	            3、医院	            4、患者
     */
    @TableField("user_type")
    private Integer userType;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 微信用户ID
     */
    @TableField("open_id")
    private String openId;

    /**
     * 消息模板ID
     */
    @TableField("template_id")
    private String templateId;

    /**
     * 标题
     */
    @TableField("title")
    private String title;

    /**
     * 消息内容
     */
    @TableField("content")
    private String content;

    /**
     * 链接地址
     */
    @TableField("url")
    private String url;

    /**
     * 消息ID
     */
    @TableField("message_id")
    private String messageId;

    /**
     * 状态	            0、未发送	            1、发送中	            2、已发送	            -1、失败
     */
    @TableField("status")
    private Integer status;

    /**
     * 预留字段
     */
    @TableField("reserved")
    private String reserved;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 删除标志，是否有效:1 可用 0不可用
     */
    @TableField("valid")
    @TableLogic
    private Integer valid;

    /**
     * 创建人
     */
    @TableField("creator")
    private Long creator;

    /**
     * 创建人姓名
     */
    @TableField("creator_name")
    private String creatorName;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField("updater")
    private Long updater;

    /**
     * 更新人姓名
     */
    @TableField("updater_name")
    private String updaterName;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号
     */
    @TableField("version")
    @Version
    private Integer version;


    public static final String ID = "id";

    public static final String ACCOUNT_ID = "account_id";

    public static final String USER_TYPE = "user_type";

    public static final String USER_ID = "user_id";

    public static final String OPEN_ID = "open_id";

    public static final String TEMPLATE_ID = "template_id";

    public static final String TITLE = "title";

    public static final String CONTENT = "content";

    public static final String URL = "url";

    public static final String MESSAGE_ID = "message_id";

    public static final String STATUS = "status";

    public static final String RESERVED = "reserved";

    public static final String REMARK = "remark";

    public static final String VALID = "valid";

    public static final String CREATOR = "creator";

    public static final String CREATOR_NAME = "creator_name";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATER = "updater";

    public static final String UPDATER_NAME = "updater_name";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
